/*
 * fdm1d.c
 *
 *  Created on: Apr 11, 2010
 *      Author: nish
 */
#include "fdm2dutils.h"



int main(){
	gsl_matrix* H;
	gsl_matrix* U;
	/*
	 * Eigen vector/Value declaration
	 */
	gsl_vector* eig_val;
	gsl_matrix* eig_vect;

	int i,j;
	printf("In the main of fdm2d\n");

	// init all constants
	printf("Initializing Constants\n");
	init2DConstants();

	printf("Preparing the Potential matrix!\n");
	U = form2DPotMatrix(STEP);

	printf("Saving the potmatrix\n");
	savePotMatrix(U);

	printf("Preparing Hmatrix\n");
	H = form2DHMatrix();
	printf("Saving HMatrix\n");
	save2DHMatrix(H,"2DHMatrix.dat");
//
	eig_val = gsl_vector_alloc(hmat_size);
	eig_vect = gsl_matrix_alloc(hmat_size,hmat_size);
//
	printf("Solving eigen values and funcs\n");
	//get eigen values and eigen vectors of Hmatrix
	solve2DEig(H,eig_val,eig_vect);
	printf("MAIN SIZE EVAL >> %d\n",eig_val->size);

	saveEigMatrices(eig_vect,5);

	//plot eigen vector, square of eigen vectors
	printf("Exiting the 11 main\n");
}

